<include file="public:header" /><br>
<link rel="stylesheet" type="text/css" href="http://o9kxq6gms.bkt.clouddn.com/js_source/artdialog/plugins/skins/idialog.css" />
<script type="text/javascript" charset="UTF-8" src="http://o9kxq6gms.bkt.clouddn.com/js_source/artdialog/artDialog.source.js.js"></script>
<script type="text/javascript" charset="UTF-8" src="http://o9kxq6gms.bkt.clouddn.com/js_source/artdialog/plugins/iframeTools.source.js"></script>
<!--会员列表-->
<div class="pad_lr_10" >
    

    <div class="J_tablelist table_list" data-acturi="{:U('user/ajax_edit')}">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th width=100><span data-tdtype="order_by" data-field="id">ID</span></th>
                <th width=100><span data-tdtype="order_by" data-field="tgroup_1_name">总经销</span></th>
                <th width=100><span data-tdtype="order_by" data-field="tgroup_2_name">经销商</span></th>
                <th width=100><span data-tdtype="order_by" data-field="tgroup_3_name">代理商</span></th>
                <th width=100><span data-tdtype="order_by" data-field="tgroup_4_name">经纪人</span></th>
                <th width=100><span data-tdtype="order_by" data-field="tgroup_4_name">全民经纪人</span></th>
                <th width=100><span data-tdtype="order_by" data-field="username">帐号/真名</span></th>
                <th width="100" ><span data-tdtype="order_by" data-field="tele">手机号码</span></th>
                <th width="40"><span data-tdtype="order_by" data-field="status" >{:L('status')}</span></th>
                <th width="120">{:L('operations_manage')}</th>
            </tr>
        </thead>
    	<tbody>
            <volist name="list" id="val" >
            <tr>
                <td align="center">{$val.id}</td>
                <td align="center">{$val.tgroup_1_name}</td>
                <td align="center">{$val.tgroup_2_name}</td>
                <td align="center">{$val.tgroup_3_name}</td>
                <td align="center">{$val.tgroup_4_name}</td>
                <td align="center">{$val.tgroup_5_name}</td>
				<td align="center">{$val.username}<br>{$val.realname}</td>
				<td align="center">{$val.tele}</td>
                <td align="center" ><span id="status_{$val.id}"> {$val.agent_status|agent}</span></td>
                <td align="center">
                    <a onclick="agent({$val.uid});">审核</a> 
					

                </td>
            </tr>
            </volist>
    	</tbody>
    </table>
    <div class="btn_wrap_fixed">
        <div id="pages">{$page}</div>
    </div>

    </div>
</div>
<include file="public:footer" />
</body>
</html>
<link rel="stylesheet" type="text/css" href="__STATIC__/js/calendar/calendar-blue.css"/>
<script type="text/javascript" src="__STATIC__/js/calendar/calendar.js"></script>
<script type="text/javascript" src="http://o9kxq6gms.bkt.clouddn.com/jQuery/jquery-1.11.1.min.js"></script>
<script>
function agent(id){
    
    
    html='<table class="table_form"width="100%"><tbody><tr><th>返佣比例：</th><td><input name="commission" id="commission"  class="input-text"  value="" size="20" type="text">%</td></tr></tbody></table>';
  
          var dialog = art.dialog({
                title: '经纪人审核',
                content: html,
                icon: 'succeed',
                okVal: '确定',
                ok: function(){
                    var commission = document.getElementById('commission');
                       if (commission.value=='') {
                        alert("请输入返佣比例");
                        return false;
                    }
                    if (commission.value>2) {
                        alert("返佣比例不能超过2%");
                        return false;
                    }
                        var url = 'http://lv.v-town.cc/index.php/?g=admin&m=user&a=agent_act';
                    $.getJSON(url, {'id': id,'commission':commission.value}, function (json)
                    {
                        
                      if(json.status==1){
                       // var status= document.getElementById('status_'+id);
                        //status.innerHTML ="已审核";
                        //$("#status_"+id).html("_blank");
                       alert(json.message);
                          $('#status_'+id).html("已审核");
                          window.location.reload();
                        return false;
                        }
                        
                        alert(json.message);
                        
                        
                    }               
                     );
                return false;
                }
                });
}
</script>